#ifndef th_tokenizer_h
#define th_tokenizer_h
#include <stdio.h>
#include <string.h>

class Tokenizer{
   public:
      Tokenizer(FILE* fp):f(fp),hascur(false){}
      bool match(char const*);
      bool matchstart(char const*);
      bool get(char*);
      bool get(int*);
      bool scan(char const*,int*);  // note: scans only one token!!!
      bool scan(char const*,char*);  // note: scans only one token!!!
      void skipline();
   protected:
      bool next();
      void check();
      int substr(char const*,char const*);
      bool eqstr(char const*,char const*);
      void movestr(int mv);
      FILE* f;
      char cur[255];
      bool hascur;
};
#endif